/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       dialog_adv_spell_target.h

	$Header: /game/dialog_adv_spell_target.h $

	$NoKeywords: $

 ************************************************************************/
#ifndef DIALOG_ADV_SPELL_TARGET_H_INCLUDED
#define DIALOG_ADV_SPELL_TARGET_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>
#include <vector>
#include "bitmap_group_ptr.h"
#include "button_group.h"
#include "dialog_box.h"

class t_hero;
enum  t_spell;
class t_text_window;

// -------------------------------------------------------------------
// choose a hero to cast a spell on
// -------------------------------------------------------------------
class t_dialog_adv_spell_target : public t_dialog_box
{
public:
	t_dialog_adv_spell_target( t_window* parent, std::vector<t_hero*> const& targets,
		                       t_spell spell );

	t_hero* get_target() const;

protected:
	t_dialog_adv_spell_target( t_window* parent );

	void                init( std::vector<t_hero*> const& targets, t_spell spell );
	virtual std::string get_status_text( t_hero const* hero ) const;
	void                select_hero( t_button*, t_hero* hero );

	t_bitmap_group_ptr				m_bitmaps;
	t_button_group					m_button_group;
	std::vector<t_hero*>			m_heroes;
	t_bitmap_group_ptr				m_layout;
	t_spell							m_spell;
	t_hero*							m_target;
	t_text_window*					m_title;
};

inline t_dialog_adv_spell_target::t_dialog_adv_spell_target( t_window* parent, 
															 std::vector<t_hero*> const& targets,
															 t_spell spell )
					   : t_dialog_box( parent )
{
	init( targets, spell );
}

inline t_dialog_adv_spell_target::t_dialog_adv_spell_target( t_window* parent )
					   : t_dialog_box( parent )
{
}

inline t_hero* t_dialog_adv_spell_target::get_target() const
{
	return m_target;
}

// -------------------------------------------------------------------
// choose a hero to cast healing on
// -------------------------------------------------------------------
class t_dialog_healing_target : public t_dialog_adv_spell_target
{
public:
	t_dialog_healing_target( t_window* parent, std::vector<t_hero*> const& targets,
							 t_spell spell );

protected:
	virtual std::string get_status_text( t_hero const* hero ) const;
};

inline t_dialog_healing_target::t_dialog_healing_target( t_window* parent,
														 std::vector<t_hero*> const& targets,
														 t_spell spell )
	:	t_dialog_adv_spell_target( parent )
{
	init( targets, spell );
}

// -------------------------------------------------------------------
// choose a hero to cast mana on
// -------------------------------------------------------------------
class t_dialog_mana_target : public t_dialog_adv_spell_target
{
public:
	t_dialog_mana_target( t_window* parent, std::vector<t_hero*> const& targets,
						  t_spell spell );

protected:
	virtual std::string get_status_text( t_hero const* hero ) const;
};

inline t_dialog_mana_target::t_dialog_mana_target( t_window* parent,
												   std::vector<t_hero*> const& targets,
												   t_spell spell )
	:	t_dialog_adv_spell_target( parent )
{
	init( targets, spell );
}

#endif // DIALOG_ADV_SPELL_TARGET_H_INCLUDED
